﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CodeAdd.aspx.cs" Inherits="FisheryPlatform.Web.Admin.ShareCode.CodeAdd" %>

<%@ Register TagName="Style" TagPrefix="Menu" Src="~/Modules/Menu/StyleMenu.ascx" %>
<%@ Register TagName="Left" TagPrefix="Menu" Src="~/Modules/Menu/LeftMenu.ascx" %>
<%@ Register TagName="Header" TagPrefix="Menu" Src="~/Modules/Menu/HeaderMenu.ascx" %>
<%@ Register TagName="Footer" TagPrefix="Menu" Src="~/Modules/Menu/FooterMenu.ascx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <Menu:Style runat="server" ID="menuStyle" Title="类别管理"></Menu:Style>
</head>
<body>
    <div class="wrapper">
        <div class="content">
            <div class="edit">
                <form id="form1" runat="server">
                <input type="hidden" id="txt_CodeId" runat="server" value="" />
                <dl>
                    <dt>类别名称/ID:</dt><dd><%= HttpUtility.HtmlEncode(ClassInfo.Name) %>/<%=ClassInfo.ClassID %></dd>
                    <dt>父代码名称/ID:</dt><dd><%= HttpUtility.HtmlEncode(ParentCodeInfo.Name)%>/<%=ParentCodeInfo.CodeID%></dd>
                    <dt>代码名称(中文):</dt><dd><input type="text" runat="server" id="txt_Name" class="txt_border txt_input1" /></dd>
                    <dt>代码名称(英文):</dt><dd><input type="text" runat="server" id="txt_NameEN" class="txt_border txt_input1" /></dd>
                    <dt>&nbsp;</dt><dd><input type="button" id="btnSubmit" value="  保  存  " />&nbsp;
                        <input type="button" onclick="window.opener=null;window.close();" value="  关  闭  " /></dd>
                </dl>
                </form>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    (function () {
        ElementValidator.className = { error: "error1", def: "tips", focus: "tips", correct: "correct" };
        var formValidator = new ElementValidator();
        formValidator.addText({ id: "txt_Name", focus: "请输入代码名称（中文）", defTips: "代码名称（中文）必填", len: { text: /^.{2,80}$/, errorMsg: "代码名称（中文）由2-80个字符组成" }, tips: { correctMsg: "OK"} });
        $(jDoc("btnSubmit")).bind("click", function () {
            if (formValidator.validate()) {
                jDoc("form1").submit();
            }
        });
    })()
</script>
<% if (ResultNum > 0)
   { %>
<script type="text/javascript">
    (function () {
        switch(<%=ResultNum %>){
            case 1:alert("保存成功");
            if(window.opener!=null){
                window.opener.jDoc.reload();
            } 
            break;
            case 2:alert("请输入'类别名称（中文）'");jDoc("txt_Name").focus();break;
            case 3:alert("保存失败");break;
            default:break;
        }
    })();
</script>
<%} %>
